﻿using System.Windows;
using System.Windows.Controls;

using VSTalk.Engine.Core.EntitySession;
using VSTalk.Model;

namespace VSTalk.Engine.Controls
{
    public class RoomLabel : Control
    {
        public Room Room
        {
            get { return (Room)GetValue(RoomProperty); }
            set { SetValue(RoomProperty, value); }
        }

        public IRoomContext Context
        {
            get { return AppServices.Get<ISessionModel>().GetRoomContext(Room); }
        }

        // Using a DependencyProperty as the backing store for Interlocutor.  This enables animation, styling, binding, etc...
        public static readonly DependencyProperty RoomProperty =
                DependencyProperty.Register("Room", typeof(Room), typeof(RoomLabel), new PropertyMetadata(null));


        static RoomLabel()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(RoomLabel), new FrameworkPropertyMetadata(typeof(RoomLabel)));
        }
    }
}